import NProgress from 'nprogress' // progress bar
import { setPageTitle } from '@/utils/index'
import 'nprogress/nprogress.css'
import router from './index'

NProgress.configure({ showSpinner: false }) // NProgress Configuration

router.beforeEach(async (to, from, next) => {
  NProgress.start()
  setPageTitle(to.meta.title)

  next()
})

router.afterEach(() => {
  NProgress.done()
})
